<div class="widget">
    {% if user.is_authenticated %}
        <h3>Привет, <span class="green">{{ user.get_profile.get_user_name }}</span></h3>
        <img src="{{ user.get_profile.get_avatar }}" class="user-panel-avatar" width="36" height="36" />
        <a href="{% url users.edit %}" title="Редактирование профиля">Редактирование профиля</a><br/>
        <a href="/rules.html" title="Правила сайта">Правила сайта</a><br/>
        <a href="{% url users.logout %}" title="Выйти из системы">Выйти</a><br/>
    {% else %}
        <h3>Привет, <span class="green">Гость</span></h3>
        <form action="{% url users.login %}" method="post">
            <p><label for="id_username">Email:</label><br/>
            <input id="id_username" type="text" name="username" maxlength="64" class="input plus-block" value="{{ form.username.value }}" /><br/>
            <label for="id_password">Пароль:</label><br/>
            <input id="id_password" type="password" name="password" maxlength="64" class="input plus-block" value="{{ form.password.value }}" /><br/>
            <input type="submit" value="Вход" class="button submit plus-block" />
            <!--<input type="button" onclick="loginUsingVkontakte();" value="VK" class="button submit plus-block" />-->
            <input type="button" value="Регистрация" onclick="javascript:location.href='{% url users.register %}'" class="button submit plus-block" />
            </p>
        </form>
    {% endif %}
</div>